package com.jason.dubbo.service;

import com.jason.api.CodeService;
import com.jason.api.vo.Response;
import com.jason.constant.ResponseConstant;
import com.jason.service.AuthCodeService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class CodeServiceImpl implements CodeService {

    @Autowired
    private AuthCodeService authCodeService;

    @Override
    public Response creteCode(String email) {
        authCodeService.generateCode(email);
        return new Response(ResponseConstant.SUCCESS);
    }

    @Override
    public Response checkCode(String email, String code) {
        authCodeService.checkEmailCode(email, code);
        return new Response(ResponseConstant.SUCCESS);
    }
}
